package engine;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;

import model.*;

/**
 * 
 * @author Brain
 * game engine updates the gameModel, contains listeners for mouse and keyboard
 * and also clock for running the game. 
 */
public class GameEngine {
	
	private KeySet keySet;
	private KeyBindingMap keyBindingMap;
	
	public GameEngine(GameModel model){
		this.keySet = new KeySet();
		this.keyBindingMap = new KeyBindingMap();
	}
	
	/*   Key handling methods                      */
	/* ------------------------------------------- */
	public void handleKeyPressed(KeyEvent event) {
		this.keySet.addKey(event.getKeyCode());
	}
	
	public void handleKeyReleased(KeyEvent event) {
		this.keySet.removeKey(event.getKeyCode());
	}
	
	public boolean isPressed(int keyCode) {
		return this.keySet.isPressed(keyCode);
	}
	/* ------------------------------------------- */
	
	
	/*   Mouse handling methods                    */
	/* ------------------------------------------- */
	public void handleMousePressed(MouseEvent event) {
		
	}
	
	public void handleMouseReleased(MouseEvent event) {
		
	}
	
	public void handleMouseMoved(MouseEvent event) {
		
	}
	
	public void handleMouseDragged(MouseEvent event) {
		
	}
	/* ------------------------------------------- */
	
	
	public void clocktick() {
		
	}
	
	
	
	
	
}
